package classes.io;


import java.io.*;

public class StandardInputOutputStream {
    public static void main(String[] args) {
        BufferedReader bufferedReader;
        bufferedReader = new BufferedReader(new InputStreamReader(System.in));  // 字节流转字符流
        String str;
        System.out.print("请输入内容：");
        try {
            while ((str = bufferedReader.readLine()) != null) {
                if ("e".equalsIgnoreCase(str) || "exit".equalsIgnoreCase(str)) {
                    System.out.println("安全退出");
                    break;
                }
                str = str.toUpperCase();
                System.out.println(str);
                System.out.print("请继续输入:");
            }
        } catch (IOException e) {
            e.printStackTrace();
        } finally {
            try {
                bufferedReader.close();
            } catch (IOException e) {
                e.printStackTrace();
            }
        }
    }
}
